import java.awt.BorderLayout;
import java.awt.EventQueue;


import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.CardLayout;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.UIManager;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.ImageIcon;
import java.awt.Color;
import java.awt.SystemColor;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.Toolkit;




public class MusicLoungeGUI extends JFrame {

	private JPanel contentPane;
	private JTextField usernameField;
	private JPasswordField passwordField;
	//private LoginPan p1;
	//private MainPan p2;
	//private GroupPan p3;
	
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					// Important to make GUI look awesome
					try {
						UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
					} 
					catch (Throwable e) {
						e.printStackTrace();
					}
					MusicLoungeGUI frame = new MusicLoungeGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MusicLoungeGUI() {
		setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Users\\User\\Documents\\Software Eng project\\pcs\\logo8.jpg"));
		setResizable(false);
		setTitle("Music Lounge");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 690, 700);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout(0, 0));
		
		JPanel LoginPan = new JPanel();
		LoginPan.setForeground(new Color(204, 51, 0));
		contentPane.add(LoginPan, "name_4294834986935");
		
		ImagePanel imgPanel = new ImagePanel("C:/Users/User/Documents/Software Eng project/pcs/background16.jpg", 680,676);
		imgPanel.setForeground(new Color(204, 51, 0));
		GroupLayout gl_LoginPan = new GroupLayout(LoginPan);
		gl_LoginPan.setHorizontalGroup(
			gl_LoginPan.createParallelGroup(Alignment.LEADING)
				.addGroup(Alignment.TRAILING, gl_LoginPan.createSequentialGroup()
					.addComponent(imgPanel, GroupLayout.PREFERRED_SIZE, 690, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		gl_LoginPan.setVerticalGroup(
			gl_LoginPan.createParallelGroup(Alignment.LEADING)
				.addComponent(imgPanel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 678, Short.MAX_VALUE)
		);
		
		usernameField = new JTextField();
		usernameField.setColumns(10);
		
		passwordField = new JPasswordField();
		
		JLabel lblUsername = new JLabel("Username");
		lblUsername.setFont(new Font("Tahoma", Font.BOLD, 11));
		lblUsername.setForeground(Color.WHITE);
		
		JLabel lblPassword = new JLabel("Password");
		lblPassword.setFont(new Font("Tahoma", Font.BOLD, 11));
		lblPassword.setForeground(Color.WHITE);
		
		JButton btnSignin = new JButton("Sign in ");
		btnSignin.setOpaque(false);
		
		JLabel lblMusicLounge = new JLabel("Music Lounge");
		lblMusicLounge.setBackground(new Color(0, 0, 0));
		lblMusicLounge.setForeground(Color.WHITE);
		lblMusicLounge.setFont(new Font("Harlow Solid Italic", Font.BOLD, 28));
		
		JLabel lbForgetpassword = new JLabel("Forgot password ?");
		lbForgetpassword.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
			}
		});
		lbForgetpassword.setForeground(Color.WHITE);
		
		JLabel lblSignUp = new JLabel("Sign up");
		lblSignUp.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				RegistrationGui account = new RegistrationGui();
				account.setVisible(true);
			}
		});
		lblSignUp.setForeground(Color.WHITE);
		
		GroupLayout gl_imgPanel = new GroupLayout(imgPanel);
		gl_imgPanel.setHorizontalGroup(
			gl_imgPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_imgPanel.createSequentialGroup()
					.addGap(33)
					.addComponent(lblMusicLounge)
					.addGap(105)
					.addGroup(gl_imgPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(usernameField, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblUsername))
					.addGap(27)
					.addGroup(gl_imgPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblPassword)
						.addGroup(gl_imgPanel.createSequentialGroup()
							.addGroup(gl_imgPanel.createParallelGroup(Alignment.LEADING)
								.addComponent(passwordField, 110, 110, 110)
								.addComponent(lbForgetpassword))
							.addGap(18)
							.addGroup(gl_imgPanel.createParallelGroup(Alignment.LEADING)
								.addComponent(lblSignUp)
								.addComponent(btnSignin))))
					.addContainerGap(34, Short.MAX_VALUE))
		);
		gl_imgPanel.setVerticalGroup(
			gl_imgPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_imgPanel.createSequentialGroup()
					.addGroup(gl_imgPanel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_imgPanel.createSequentialGroup()
							.addContainerGap()
							.addGroup(gl_imgPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblPassword, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE)
								.addComponent(lblUsername, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_imgPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(passwordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(usernameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(btnSignin))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_imgPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lbForgetpassword)
								.addComponent(lblSignUp)))
						.addGroup(gl_imgPanel.createSequentialGroup()
							.addGap(40)
							.addComponent(lblMusicLounge)))
					.addContainerGap(586, Short.MAX_VALUE))
		);
		imgPanel.setLayout(gl_imgPanel);
		LoginPan.setLayout(gl_LoginPan);
		
		JPanel MainPan = new JPanel();
		contentPane.add(MainPan, "name_4318616669588");

		
		JPanel GroupPan = new JPanel();
		contentPane.add(GroupPan, "name_4323291395140");
	}
}
